package com.bdth.bdthmall.api.epoint.utils;

import com.bdth.bdthmall.api.datas.CommonDatas;

/**
 * Created by Administrator on 2020/1/13.
 */
public class TokenFactory {
    public static String generatorOfMd5(String... strings){
        TokenGenerator generator = new Md5TokenGenerator();
        String token = generator.generate(strings);
        saveToken(token,strings[0]);
        return token;
    }

    //保存Token到内存列表中
    private static void saveToken(String token, String appKey){
        CommonDatas.epointToken.put(token, appKey);
        CommonDatas.epointAppKey.put(appKey, token);
        Long currentTime = System.currentTimeMillis();
        CommonDatas.epointTokenTime.put(token,currentTime.toString());
    }
}
